# -*- coding: utf-8 -*-

from django.db import models
import time

class UserInfo(models.Model):
    '''用户信息表'''
    id = models.AutoField(primary_key=True)
    username = models.CharField(max_length=30)
    userphone = models.CharField(max_length=30,unique=True)
    parent_id = models.PositiveIntegerField(default=0)


class User(models.Model):
    uid = models.AutoField(primary_key=True)
    nickname=models.CharField(default='',max_length=100,help_text=u"用户信息")
    avatar=models.CharField(default='',max_length=200,help_text=u"用户信息")

    appid = models.CharField(max_length=11,help_text=u'')
    addtime = models.PositiveIntegerField(default=int(time.time()),help_text=u'测试时间')
    openid = models.CharField(max_length=100, default='', help_text=u" 用户openid")
    grade = models.CharField(max_length=100,help_text=u'结果成绩')
    class Meta:
        db_table = 'user'
        ordering = ['uid']
